<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
     table,table tr th, table tr td { border:0.05px solid #000000; text-align: center;}
        table{
            width: 100%;
        }
    </style>
</head>
<body>
<form action="/hn/find/" method="post">
    <input type="text" name = 'code0'>开奖号码1
    <input type="text" name = 'code1'>开奖号码2
    <input type="text" name = 'code2'>开奖号码3
    <input type="submit" value="查询">
</form>
</br>
<div>
<table id = 'a123' cellspacing="0" cellpadding="5" >
 <thead>
                <tr>
                    <th style="text-align: center;">期号</th>
                    <th style="text-align: center;" colspan="6">开奖结果</th>
                     <th style="text-align: center;" >重号</th>
                    <th style="text-align: center;">一期号</th>
                    <th style="text-align: center;">二期号</th>
                    <th style="text-align: center;">三期号</th>
                    <th style="text-align: center;">四期号</th>
                    <th style="text-align: center;">五期号</th>
                    <th style="text-align: center;">六期号</th>
                    <th style="text-align: center;">超六期号</th>
                </tr>
                </thead>
                 <tbody>
                 <tr>
                    <td>201801</td>
                    <td>1</td>
                    <td></td>
                    <td>3</td>
                    <td></td>
                    <td></td>
                    <td>6</td>
                    <td>1</td>
                    <td></td>
                    <td>3</td>
                    <td></td>
                    <td>5</td>
                    <td></td>
                    <td></td>
                    <td></td>
                 </tr>
                   <tr>
                    <td>201802</td>
                    <td></td>
                    <td>2</td>
                    <td></td>
                    <td>4</td>
                    <td>5</td>
                    <td></td>
                    <td></td>
                    <td>2</td>
                    <td>3</td>
                    <td></td>
                    <td>5</td>
                    <td></td>
                    <td></td>
                    <td></td>
                 </tr>
                  <tr>
                    <td>201801</td>
                    <td></td>
                    <td></td>
                    <td><font color="red">3</font></td>
                    <td></td>
                    <td></td>
                    <td>6</td>
                    <td>1</td>
                    <td></td>
                    <td>3</td>
                    <td></td>
                    <td>5</td>
                    <td></td>
                    <td></td>
                    <td></td>
                 </tr>
                 </tbody>

</table>
</div>
</body>
<script type="text/javascript"  src="/static/js/jquery-3.2.1.js"></script>
<script>
    function test() {
            console.log("请求准备发送");

            $.ajax({
                type : "POST",
                url : "/hn/search_all/",
                dataType : "json",
                success : function(data) {
{#                    alert('请求成功')#}
{#                    alert(data[1])#}
{#                    alert(data)#}
                    var obj = eval(data) {#  格式化请求的数据#}
                    console.log(data.length)
                    $.each(data,function (index,item) {
                        var id = obj[index].id
                        var lusse = obj[index].lusse
                        var code_0 = obj[index].code_0
                        var code_1 = obj[index].code_1
                        var code_2 = obj[index].code_2
{#                        console.log(id,lusse,code_0,code_1,code_2)#}
{#                        console.log(code_0)#}
{#                        console.log(code_1)#}
{#                        console.log(code_2)#}
{#                        console.log('--------------')#}
                        var data_show = " <tr><td>"+id+"</td><td>"+lusse+"</td><td>"+code_0+"</td><td>"+code_1+"</td><td>"+code_2+"</td></td>"
{#                        console.log(data_show)#}
                        $("#a123").append(data_show)

                    })
                },
            });
        }
        test()
</script>
</html>